<template>

  <div>
    <div class="common-form">其它</div>
    <el-form-item label="限购数量" prop="limit_num" :rules="[{ required: true, message: '请填写限购数量' }]">
      <el-input type="number" v-model="form.limit_num" class="max-w460"></el-input>
    </el-form-item>
    <el-form-item label="开团人数" prop="assemble_num"
      :rules="[{ required: true, message: '开团人数最少为2',validator:assembleLimitnum }]">
      <el-input type="number" v-model="form.assemble_num" class="max-w460"></el-input>
    </el-form-item>
  </div>
</template>

<script>
  export default {
    inject: ['form'],
    data() {
      return {

      }
    },
    methods: {
      assembleLimitnum(rule, value, callback) {
        if (value === '') {
          callback(new Error('请输入开团人数'));
        } else if (value <= 1) {
          callback(new Error('开团人数最少为1'));
        } else {
          callback();
        }
      }
    }
  };
</script>

<style></style>
